<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_course_signin_student".
 *
 * @property string $id Primary Key:   ID.
 * @property string $sign_id 签到事件id
 * @property string $user_id 用户id
 * @property string $code 签到码
 * @property string $status 签到状态
 * @property string $signin_time 签到时间
 * @property int $sign_person_type 签到人类型，教师补签：1，学生自己签到：2
 * @property string $student_status 学生状态0正常1迟到2早退3请假4旷课
 * @property string $address 签到位置
 * @property string $major_id
 * @property string $create_by
 * @property string $create_time
 * @property string $update_by
 * @property string $update_time
 * @property int $del_flag
 * @property string $latitude 维度
 * @property string $longitude 经度
 */
class TCourseSigninStudent extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_course_signin_student';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'student_status', 'create_time', 'del_flag'], 'required'],
            [['signin_time', 'create_time', 'update_time'], 'safe'],
            [['sign_person_type', 'del_flag'], 'integer'],
            [['latitude', 'longitude'], 'number'],
            [['id', 'sign_id', 'user_id', 'major_id', 'create_by', 'update_by'], 'string', 'max' => 36],
            [['code'], 'string', 'max' => 128],
            [['status', 'student_status'], 'string', 'max' => 64],
            [['address'], 'string', 'max' => 255],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'sign_id' => 'Sign ID',
            'user_id' => 'User ID',
            'code' => 'Code',
            'status' => 'Status',
            'signin_time' => 'Signin Time',
            'sign_person_type' => 'Sign Person Type',
            'student_status' => 'Student Status',
            'address' => 'Address',
            'major_id' => 'Major ID',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'del_flag' => 'Del Flag',
            'latitude' => 'Latitude',
            'longitude' => 'Longitude',
        ];
    }
}
